\(\int \frac {\sqrt {1-x^2}}{1+x^2} \, dx\) [71]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 30 \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=-\arcsin (x)+\sqrt {2} \arctan \left (\frac {\sqrt {2} x}{\sqrt {1-x^2}}\right ) \]

[Out]

-arcsin(x)+arctan(x*2^(1/2)/(-x^2+1)^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {399, 222, 385, 209} \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=\sqrt {2} \arctan \left (\frac {\sqrt {2} x}{\sqrt {1-x^2}}\right )-\arcsin (x) \]

[In]

Int[Sqrt[1 - x^2]/(1 + x^2),x]

[Out]

-ArcSin[x] + Sqrt[2]*ArcTan[(Sqrt[2]*x)/Sqrt[1 - x^2]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 399

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Dist[b/d, Int[(a + b*x^n)^(p - 1), x]
, x] - Dist[(b*c - a*d)/d, Int[(a + b*x^n)^(p - 1)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c
 - a*d, 0] && EqQ[n*(p - 1) + 1, 0] && IntegerQ[n]

Rubi steps \begin{align*} \text {integral}& = 2 \int \frac {1}{\sqrt {1-x^2} \left (1+x^2\right )} \, dx-\int \frac {1}{\sqrt {1-x^2}} \, dx \\ & = -\sin ^{-1}(x)+2 \text {Subst}\left (\int \frac {1}{1+2 x^2} \, dx,x,\frac {x}{\sqrt {1-x^2}}\right ) \\ & = -\sin ^{-1}(x)+\sqrt {2} \tan ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {1-x^2}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.53 \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=\sqrt {2} \arctan \left (\frac {\sqrt {2} x}{\sqrt {1-x^2}}\right )+2 \arctan \left (\frac {\sqrt {1-x^2}}{1+x}\right ) \]

[In]

Integrate[Sqrt[1 - x^2]/(1 + x^2),x]

[Out]

Sqrt[2]*ArcTan[(Sqrt[2]*x)/Sqrt[1 - x^2]] + 2*ArcTan[Sqrt[1 - x^2]/(1 + x)]

Maple [A] (verified)

Time = 2.62 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.10

method result size
default \(-\arcsin \left (x \right )-\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {-x^{2}+1}\, x}{x^{2}-1}\right )\) \(33\)
pseudoelliptic \(\arctan \left (\frac {\sqrt {-x^{2}+1}}{x}\right )-\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {-x^{2}+1}}{2 x}\right )\) \(39\)
trager \(\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \sqrt {-x^{2}+1}+x \right )-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) \ln \left (\frac {3 \operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) x^{2}+4 x \sqrt {-x^{2}+1}-\operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right )}{x^{2}+1}\right )}{2}\) \(78\)

[In]

int((-x^2+1)^(1/2)/(x^2+1),x,method=_RETURNVERBOSE)

[Out]

-arcsin(x)-2^(1/2)*arctan(2^(1/2)*(-x^2+1)^(1/2)/(x^2-1)*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.40 \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=-\sqrt {2} \arctan \left (\frac {\sqrt {2} \sqrt {-x^{2} + 1}}{2 \, x}\right ) + 2 \, \arctan \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) \]

[In]

integrate((-x^2+1)^(1/2)/(x^2+1),x, algorithm="fricas")

[Out]

-sqrt(2)*arctan(1/2*sqrt(2)*sqrt(-x^2 + 1)/x) + 2*arctan((sqrt(-x^2 + 1) - 1)/x)

Sympy [F]

\[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=\int \frac {\sqrt {- \left (x - 1\right ) \left (x + 1\right )}}{x^{2} + 1}\, dx \]

[In]

integrate((-x**2+1)**(1/2)/(x**2+1),x)

[Out]

Integral(sqrt(-(x - 1)*(x + 1))/(x**2 + 1), x)

Maxima [F]

\[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=\int { \frac {\sqrt {-x^{2} + 1}}{x^{2} + 1} \,d x } \]

[In]

integrate((-x^2+1)^(1/2)/(x^2+1),x, algorithm="maxima")

[Out]

integrate(sqrt(-x^2 + 1)/(x^2 + 1), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (24) = 48\).

Time = 0.28 (sec) , antiderivative size = 95, normalized size of antiderivative = 3.17 \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=-\frac {1}{2} \, \pi \mathrm {sgn}\left (x\right ) + \frac {1}{2} \, \sqrt {2} {\left (\pi \mathrm {sgn}\left (x\right ) + 2 \, \arctan \left (-\frac {\sqrt {2} x {\left (\frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 1\right )}}{4 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right )\right )} - \arctan \left (-\frac {x {\left (\frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 1\right )}}{2 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right ) \]

[In]

integrate((-x^2+1)^(1/2)/(x^2+1),x, algorithm="giac")

[Out]

-1/2*pi*sgn(x) + 1/2*sqrt(2)*(pi*sgn(x) + 2*arctan(-1/4*sqrt(2)*x*((sqrt(-x^2 + 1) - 1)^2/x^2 - 1)/(sqrt(-x^2
+ 1) - 1))) - arctan(-1/2*x*((sqrt(-x^2 + 1) - 1)^2/x^2 - 1)/(sqrt(-x^2 + 1) - 1))

Mupad [B] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.77 \[ \int \frac {\sqrt {1-x^2}}{1+x^2} \, dx=-\mathrm {asin}\left (x\right )+\frac {\sqrt {2}\,\ln \left (\frac {\frac {\sqrt {2}\,\left (-1+x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}-\sqrt {1-x^2}\,1{}\mathrm {i}}{x-\mathrm {i}}\right )\,1{}\mathrm {i}}{2}-\frac {\sqrt {2}\,\ln \left (\frac {\frac {\sqrt {2}\,\left (1+x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\sqrt {1-x^2}\,1{}\mathrm {i}}{x+1{}\mathrm {i}}\right )\,1{}\mathrm {i}}{2} \]

[In]

int((1 - x^2)^(1/2)/(x^2 + 1),x)

[Out]

(2^(1/2)*log(((2^(1/2)*(x*1i - 1)*1i)/2 - (1 - x^2)^(1/2)*1i)/(x - 1i))*1i)/2 - asin(x) - (2^(1/2)*log(((2^(1/
2)*(x*1i + 1)*1i)/2 + (1 - x^2)^(1/2)*1i)/(x + 1i))*1i)/2